import requests
# 使用get方式发送请求
# 在地址栏拼接参数 www.xxx.com/?key1=value1&key2=value2
# {key1:value1}
# Requests处理这种方式还可以使用params传参
# response = requests.get("https://www.baidu.com/s?wd=python")
'''data = {'wd':"java"}
response = requests.get("https://www.baidu.com/s",params=data)
print(response.url)
print(response.text)'''

# 需要添加用户代理放进请求头，则可以正常得到响应
'''headers={
    "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0"
}
requests.get("http://www.baidu.com")
rep = requests.get("https://www.baidu.com",headers=headers)
print(rep.content.decode("utf-8"))'''